﻿using System.Windows.Input;
using Faz.SideWinderSC.Client.ViewModel;

namespace Faz.SideWinderSC.Client
{
    /// <summary>
    /// Defines the execution view.
    /// </summary>
    public partial class ExecutionWindow : BaseWindow
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ExecutionWindow"/> class.
        /// </summary>
        public ExecutionWindow()
        {
            this.InitializeComponent();
        }

        /// <summary>
        /// Gets the associated view-model.
        /// </summary>
        protected ExecutionViewModel ViewModel
        {
            get { return this.DataContext as ExecutionViewModel; }
        }

        /// <summary>
        /// Called to execute the "Browse Back" command.
        /// </summary>
        /// <param name="sender">The parameter is not used.</param>
        /// <param name="e">The parameter is not used.</param>
        private void OnBrowseBackExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            ConfigurationWindow window = new ConfigurationWindow();
            App.Current.MainWindow = window;
            App.Current.MainWindow.Show();
            this.Close();
        }
    }
}
